<?php

namespace app\admin\model\procure;

use think\Model;

/**
 * Suppliers
 */
class Suppliers extends Model
{
    // 表主键
    protected $pk = 'supplierid';
    
    // 表名
    protected $name = 'procure_suppliers';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function supptypeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\procure\Suppliertype::class, 'supptype', 'typeid');
    }

    public function currcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Currencies::class, 'currcode', 'currabrev');
    }

    public function paymenttermsTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\sales\Paymentterms::class, 'paymentterms', 'termsindicator');
    }

    public function taxgroupidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Taxgroups::class, 'taxgroupid', 'taxgroupid');
    }
}